package cn.lee.test.model;

import cn.lee.test.common.base.model.BaseJpaModel;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author : lichl(李承霖)
 * create: 2022/2/23 23:21 周三
 */

@Data
@Entity
@Table(
  name = "user",
  indexes = {
    @Index(name = "id", columnList = "id", unique = true),
    @Index(name = "user_name", columnList = "userName", unique = true)
  }
)
@ApiModel("用户表")
public class User extends BaseJpaModel implements Serializable{
  
  @Column(unique = true,nullable = false,length = 30)
  private String userName;
  
  @Column(nullable = false,length = 60)
  @JsonIgnore
  private String password;
  
  @Column(length = 30)
  private String userNickName;
  
  @Column(length = 3)
  private Integer Age;
  
  @Column
  @JsonIgnore
  private String status = "Active"; // 后续可以改成枚举类型,默认为激活状态
}
